<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="public/style/public.css" />
<link rel="stylesheet" type="text/css" href="public/style/index.css" />
<script type='text/javascript' src='public/jquery-1.10.1.min.js'></script>
<script type='text/javascript' src='public/layer/layer.js'></script>
<script>

$(function () {
	//退出登录
	$('#logout').click(function(){


		layer.confirm('确认退出吗?',{btn:['确认','取消']},function(){

			$.ajax({
				type:'post',
				url:'logout.php?act=logout',
				dataType:'json',
				success:function(res){

					//关闭所有层
					//layer.closeAll();

					if(res.status==1){

						layer.msg(res.msg, {icon: 6});
						setTimeout("window.location.href='index.php'",3000);
						//setTimeout("window.location.reload()",1500);
					}else{

						layer.msg(res.msg, {icon: 5});
						//layer.closeAll();
					}

				}

			});

		},function(){


		});


	});

});

</script>
</head>
<body>
	<div class="header_wrap">
		<div id="header" class="auto">
			<div class="logo">小杰论坛</div>
			<div class="nav">
				<a class="hover">首页</a>
			</div>
			<div class="serarch">
				<form>
					<input class="keyword" type="text" name="keyword" placeholder="搜索其实很简单" />
					<input class="submit" type="submit" name="submit" value="" />
				</form>
			</div>
		<?php if(empty($_SESSION['pro_username'])){  ?>
			<div class="login">
				<a href="login.php">登录</a>&nbsp;
				<a href="register.php">注册</a>
			</div>
		<?php }else{ ?>
				<a id="logout" style="color:#a25454;position: absolute;right: 50px;top: 0px;cursor: pointer;" >退出登录</a>
				<span style="float: right;color: #105cb6;">欢迎回来: <a style="color: white;cursor: pointer;"><?php echo $_SESSION['pro_username']; ?></a></span>


		<?php    }  ?>
		</div>
	</div>
	<div style="margin-top:55px;"></div>
	<div id="hot" class="auto">
		<div class="title">热门动态</div>
		<ul class="newlist">
			<!-- 20条 -->

			<?php

			foreach($data as $row){

			?>

			<li>
				<a href="#">
					<?php

					foreach($newstype as $v){

						if($row['cid'] ==$v[0]){

							echo '['.$v[1].']';

						}

					}

					?>
				</a>
				<a href="news.php?id=<?php echo $row['id']; ?>"><?php echo $row['title'] ?></a>
			</li>

			<?php

				}

			?>
		</ul>
		<div style="clear:both;"></div>
	</div>
	<?php foreach($modul4 as $v){ ?>
	<div class="box auto">
		<div class="title">
			<?php echo $v['title'] ?>
		</div>
		<div class="classList">
			<?php
			$sql3 = "select * from bbs_forum WHERE pid = {$v['id']}";
			$res3 = mysql_query($sql3);
			$count = mysql_num_rows($res3);
			?>
			<?php if($count===0){?>

					<div style="padding:10px 0;">暂无子版块...</div>

			<?php }else{ ?>

			<?php while($rows = mysql_fetch_assoc($res3)){ ?>

				<div class="childBox new">
					<h2><a href="forum.php?id=<?php echo $rows['id']; ?>"><?php echo $rows['title']; ?></a><span>(今日38)</span></h2>
					帖子：1939539<br />
				</div>


			<?php } ?>
					<div style="clear:both;"></div>

			<?php } ?>
		</div>
	</div>
	<?php } ?>
	<div class="box auto">
		<div class="title">
			-----CBA-----
		</div>
		<div class="classList">
			<div style="padding:10px 0;">暂无子版块...</div>
			<div style="clear:both;"></div>
		</div>
	</div>

	<div class="box auto">
		<div class="title">
			最新游戏
		</div>
		<div class="classList">
			<div class="childBox new">
				<h2><a href="#">A队</a> <span>(今日38)</span></h2>
				帖子：1939539<br />
			</div>
			<div class="childBox old">
				<h2><a href="#">B队</a> <span>(今日38)</span></h2>
				帖子：1939539<br />
			</div>
			<div class="childBox lock">
				<h2><a href="#">C队</a> <span>(今日38)</span></h2>
				帖子：1939539<br />
			</div>
			<div class="childBox new">
				<h2><a href="#">D队</a> <span>(今日38)</span></h2>
				帖子：1939539<br />
			</div>
			<div style="clear:both;"></div>
		</div>
	</div>
	<div id="footer" class="auto">
		<div class="bottom">
			<a>小杰论坛</a>
		</div>
		<div class="copyright">Powered by zxj ©2015 www.zhaoxiaojie.club</div>
	</div>
</body>
</html>